<%include pub/head.html%>
  </head>
  <body>
  	<%include pub/left-nav.html%>
  	<div class="xu-main-bar">
  		<%include pub/usernav.html%>
  		<div class="xu-main-body">
  			<h3>我的学生</h3>
  			<div class="control-xu-bar row">
					<div class="dropdown student-select">
					  <button class="btn btn-default dropdown-toggle" type="button" id="classname" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
					  		<span id="checked-classname">全部学生</span>
							<span class="caret"></span>
						</button>
						<%if(classlist.length > 0){%>
						<ul class="dropdown-menu" aria-labelledby="classname" id="classname-item">
							<li><a href="/school/student/all">全部学生</a></li>
							<%for(let i = 0;i < classlist.length; i++){%>
							<li><a href="/school/student?classid=<%- classlist[i]._id %>"><%= classlist[i].classname %></a></li>
							<%}%>
						</ul>
						<%}%>
					</div>
					<div class="search-bar">
						<input type="text" placeholder="搜索学生姓名" id="search-stu-input">
						<button type="button" class="xu-btn" id="search-stu-btn"><i class="icon iconfont icon-sousuo"></i></button>
					</div>
				</div>
  			<div class="main-panel">
  				<div class="xu-table">
	  				<table>
						  <thead>
								<tr class="head">
									<th>序号</th>
									<th>帐号</th>
									<th>昵称</th>
									<th>真实姓名</th>
									<th>联系电话</th>
									<th>QQ</th>
									<th>微信</th>
									<th>邮箱</th>
									<th>备注信息</th>
									<th>所在班级</th>
									<th>操作</th>
						    </tr>
						  </thead>
							<tbody>
								<%for(let i = 0; i < stulist.length; i++){%>
								<tr>
									<td class="order"><%= i+1 %></td>
									<td><%= stulist[i].username %></td>
									<td><%= stulist[i].nickname %></td>
									<td class="sturn"><%= stulist[i].realname %></td>
									<td class="stupn"><%= stulist[i].phoneNum %></td>
									<td class="stuqq"><%= stulist[i].qq %></td>
									<td class="stuwx"><%= stulist[i].wx %></td>
									<td class="stuem"><%= stulist[i].email %></td>
									<td><%= stulist[i].remark %></td>
									<td class="tab_classlist">
										<% var klass = stulist[i].classlist; for(let ii=0; ii < klass.length; ii++){ %>
											<%if(klass[ii].klassid){%>
											<%if(classlist.toString().indexOf(klass[ii].klassid._id) > 0){%>
											<span class="spanclass" cid="<%= klass[ii].klassid._id %>"><%= klass[ii].klassid.classname %></span>
											<%}}else{%>
											<span class="spanclass">暂无班级</span>
											<%}%>
										<%}%>
										<%if(stulist[i].classlist.length == 0){%>
										<span class="spanclass">暂无班级</span>
										<%}%>
									</td>
						      <td class="opt" uid="<%- stulist[i]._id %>">
						      	<span class="editsmsg">修改信息</span>
										<i class="split">|</i>
						      	<span class="editstu">备注</span>
										<i class="split">|</i>
										<span class="resetstupwd">重置密码</span>
									</td>
								</tr>
								<%}%>
						  </tbody>
						</table>
						<%if(!stulist || stulist.length == 0){%>
							<div class="notable"><i class="icon iconfont icon-Null-data"></i> 暂无数据</div>
						<%}%>
					</div>
  			</div>
  		</div>
  	</div>
  	<!-- 备注信息 Modal -->
		<div class="modal fade classmodal modal-small" id="pubstuModal" tabindex="-1" role="dialog">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title"></h4>
		      </div>
		      <div class="modal-body">
		      	<input type="hidden" id="def-control">
		      	<input type="hidden" id="getstuId">
		        <textarea class="form-control modal-form-control" rows="3" id="stutextarea"></textarea>
		      </div>
		      <div class="modal-footer">
		      	<button type="button" id="control-stu-btn" class="xu-btn xu-btn-blue" >确 认</button>
					  <button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
		      </div>
		    </div>
		  </div>
		</div>
		<!-- 修改信息 Modal -->
		<div class="modal fade classmodal" id="editsmsgModal" tabindex="-1" role="dialog">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title">修改基本信息</h4>
		      </div>
		      <div class="modal-body">
		      	<input type="hidden" id="editstuId">
		        <p class="skeoww first">真实姓名</p>
        		<input type="text" class="form-control" id="e-stu-realname">
        		<p class="skeoww">联系电话</p>
        		<input type="text" class="form-control" id="e-stu-phone">
        		<p class="skeoww">QQ</p>
        		<input type="text" class="form-control" id="e-stu-qq">
        		<p class="skeoww">微信</p>
        		<input type="text" class="form-control" id="e-stu-wx">
        		<p class="skeoww">邮箱</p>
        		<input type="text" class="form-control" id="e-stu-email">
		      </div>
		      <div class="modal-footer">
		      	<button type="button" id="editmsg-stu-btn" class="xu-btn xu-btn-blue" >确 认</button>
					  <button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
		      </div>
		    </div>
		  </div>
		</div>
  	<%include pub/foot.html%>
  </body>
</html>
